﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DeptList.aspx.cs" Inherits="basedept_DeptList" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>部门列表</title>
    <link href="../../css/MyCss.css" rel="stylesheet" type="text/css" />
    <link href="../../Includes/Guide.css" type="text/css" rel="stylesheet" />
     <link href="../../Includes/index.css" type="text/css" rel="stylesheet" />
    <link href="../../Includes/MasterPage.css" type="text/css" rel="stylesheet" />
    <link href="../../Includes/xtree.css" type="text/css" rel="stylesheet" />
    <link href="../../css/JsControlGrid.css" rel="stylesheet" type="text/css" />
   <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    </head>
    <script src="../../js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script src="../../Includes/jquery-1.4.1.js" type="text/javascript"></script>
<script src="../../Includes/MyJScript.js" type="text/javascript"></script>
<script src="../../Includes/AdminIndex.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
//    (function() {
//        /**//*Use Object Detection to detect IE6*/
//        var m = document.uniqueID /**//*IE*/
//    && document.compatMode  /**//*>=IE6*/
//    && !window.XMLHttpRequest /**//*<=IE6*/
//    && document.execCommand;

//        try {
//            if (!!m) {
//                m("BackgroundImageCache", false, true) /**//* = IE6 only */
//            }

//        } catch (oh) { };
    //    })();
    
    function checkall(cb) {
        var cbs = document.getElementsByTagName("input");
        for (var i = 0; i < cbs.length; i++) {
            if (cbs[i].type == "checkbox") {
                cbs[i].checked = cb.checked;
            }


        }
    }
    $(document).ready(function() {
       
        $("#btnDel").click(function() {
            if (!confirm("是否删除当前单据？"))
                return false;
        });
        
        $("#spanSec").click(function() {
            document.getElementById("btnSec").click();
        });

    });
    //关闭当前窗口
    function winCancel() {
        parent.PE_FrameTab.CloseCurrentTab();
    }
    
</script>

<body  onload="initSec(document.getElementById('<%= keyword.ClientID %>'), document.getElementById('<%= forkeyword.ClientID %>'))" scroll="no">
    <form id="dept" runat="server">
    <div class="inputbuttondiv">
        <asp:Button class="inputbutton" ID="btnAdd" runat="server" Text="新增" 
            onclick="btnAdd_Click" />
        <asp:Button class="inputbutton" ID="btnUpd" runat="server" Text="修改" 
            onclick="btnUpd_Click" />
        <asp:Button ID="btnDel" runat="server" Text="删除" class="inputbutton" OnClick="deptdel_Click"/>
        <asp:Button ID="btnCong" runat="server" Text="停用" class="inputbutton" />
        <asp:Button ID="btnSave" runat="server" Text="保存" class="inputbutton" 
            onclick="btnSave_Click" />
        <asp:Button ID="btnClose" runat="server" Text="关闭" class="inputbutton" OnClientClick="winCancel()"/>
        
    </div>
    <hr />
    <table cellspacing="0" cellpadding="0" border="0" style="overflow:hidden;height:551px" class="item" >
      
        <tr style="vertical-align: top;" >
            <td rowspan="3"  id="frmTitle" style="width:200px">
            
                <asp:TreeView ID="deptTreeView" runat="server" ShowLines="True" 
                    onselectednodechanged="deptTreeView_SelectedNodeChanged">
                </asp:TreeView>
            </td>
            <td rowspan="3" onclick="baseLeftswitchSysBar();">
            
                    <img id="switchPoint" style="border-right: 0px; border-top: 0px; border-left: 0px;
                        width:12px; border-bottom: 0px" alt="关闭左栏" 
                    src="../../Images/butClose.gif" /></td>
            <td id="frmRight" colspan="2" style="width:80%;height:100px">
            
    <div class="search">
   
    <asp:TextBox ID="keyword" runat="server" CssClass="input" style="float:left;"></asp:TextBox>
    <asp:Label ID="forkeyword" runat="server" Text="请输入关键字" CssClass="label"></asp:Label>
    <span class="submit" id="spanSec" title="搜索">
    <asp:ImageButton ID="btnSec" runat="server"  OnClick="secBtn_Click"/></span>
    </div>
 
     <div style=" height:250px;width:830px;" title="gridViewdiv" class="baseGridViewDiv">
        <asp:GridView ID="deptListGridView" runat="server" AutoGenerateColumns="False" DataKeyNames="id"
        style="width:800px;"  CssClass="baseGridView"
            onrowdatabound="deptListGridView_RowDataBound" 
            onselectedindexchanged="deptListGridView_SelectedIndexChanged"
             >
            <SelectedRowStyle CssClass="gridSelectedRow" />
            <HeaderStyle CssClass="FixedTitleRow" />
        <Columns>
                <asp:TemplateField HeaderText="序号" ShowHeader="False">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                            CommandName="Select" Text="<%# Container.DataItemIndex+1 %>"></asp:LinkButton>
                    </ItemTemplate>
                    <HeaderStyle Width="50px"></HeaderStyle>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:TemplateField>
                <asp:BoundField DataField="deptNo" HeaderText="部门代码" >
                 <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                 <asp:BoundField DataField="DeptName" HeaderText="部门名称" 
                    SortExpression="DeptName" >
                
                <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                
                <asp:BoundField DataField="Manager" HeaderText="负责人" SortExpression="Manager" >
                
                <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                
                <asp:BoundField DataField="Phone" HeaderText="固定电话" SortExpression="Phone" >
                <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="telephone" HeaderText="移动电话" 
                    SortExpression="telephone" >
                <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="Fax" HeaderText="传真" SortExpression="Fax" >
                <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="上级部门" SortExpression="IsEnd">
                    
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# tool.getDeptName(Eval("IsEnd")) %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:TemplateField>
                <asp:BoundField DataField="Remarks" HeaderText="备注" SortExpression="Remarks" >
                <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="id" HeaderText="id" >
                <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
            </Columns>
        </asp:GridView>
    </div>
            </td>
        </tr>
      
        <tr style="vertical-align: top;height:12px;">
            <td  class="but" align="right" onclick="baseTopswitchSysBar();" style="height:12px">
                 <img id="topswitchPoint" style="border-right: 0px; border-top: 0px; border-left: 0px; 
                        border-bottom: 0px" alt="关闭上栏" src="../../Images/butClosetop.GIF" /></td>
            <td  class="but" align="left" onclick="baseBottomswitchSysBar();" style="height:12px">
                 <img id="bottomswitchPoint" style="border-right: 0px; border-top: 0px; border-left: 0px;
                        border-bottom: 0px" alt="关闭下栏" src="../../Images/butClosebottom.GIF" /></td>
        </tr>
        <tr>
            <td colspan="2" align="left" valign="top" id="frmBottom">
            <table align="left" class="item">
    <tr>
        <td class="tdbg">
            部门代码：</td>
        <td align="left">
            <asp:TextBox ID="txtdeptNo" runat="server"  CssClass="inputtext" Width="148px"></asp:TextBox>
          
        </td>
        <td class="tdbg">
            部门名称：</td>
         <td align="left">
             <asp:TextBox ID="txtdeptName" runat="server"  CssClass="inputtext" Width="142px"></asp:TextBox>
            
        </td>
         <td class="tdbg">
            负 责 人：</td>
         <td align="left">
            <asp:TextBox ID="txtmanager" runat="server" CssClass="inputtext" Width="124px"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td class="tdbg">
             固定电话：</td>
        <td align="left">
            <asp:TextBox ID="txtphone" runat="server" CssClass="inputtext" Width="148px"></asp:TextBox>
        </td>
         <td class="tdbg">
            传&nbsp;&nbsp; 真：</td>
        <td align="left">
            <asp:TextBox ID="txtfax" runat="server" CssClass="inputtext" Width="142px"></asp:TextBox>
        </td>
        <td class="tdbg">
            上级部门：</td>
        <td align="left">
            <asp:DropDownList ID="ddlisEnd" runat="server" 
                Width="130px" AppendDataBoundItems="True">
                <asp:ListItem Value="0">-请选择-</asp:ListItem>
            </asp:DropDownList>
        </td>
    </tr>
    <tr>
        <td class="tdbg">
            移动电话：</td>
         <td align="left">
             <asp:TextBox ID="txtTelephone" runat="server" CssClass="inputtext" Width="148px"></asp:TextBox>
        </td>
        
        <td class="tdbg">
             备&nbsp; &nbsp;注： </td>
        <td align="left" colspan="3"><asp:TextBox ID="txtremarks" runat="server" CssClass="inputtext"  Width="369px"></asp:TextBox>
           </td>
    </tr>
    </table>
            </td>
        </tr>
        
        </table>
    <asp:HiddenField ID="pageFlag" runat="server" />
    </form>
</body>
</html>
